<?php
include('../includes/config.php');
$id = $_GET['id'];
$sql = "select * from categories where id=$id";
$r = $db->getRow($sql);
//select true from component where 20 in (2,20)
$sql = "select true from component where " . $r['comp'] . " in (" . $_GET['comp'] . ")";

$r = $db->getAll($sql);

if($r && count($r) > 5)
	echo $id;
else
	echo 0;
?>